package com.suyang.syt.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.suyang.syt.dao.interfaces.WeixinMenuDao;
import com.suyang.syt.model.WeixinMenu;

@Repository
public class WeixinMenuDaoImpl extends BaseDaoImpl<WeixinMenu> implements WeixinMenuDao {

	@Override
	public void deletes(String ids) {
		this.executeByHql("delete from WeixinMenu where id in(" + ids + ")");
	}

	@Override
	public WeixinMenu getByKey(String eventKey) {
		String hql = " from WeixinMenu where key=? ";
		List<WeixinMenu> list = this.list(hql, eventKey);
		if (list != null && list.size() == 1) {
			return list.get(0);
		}
		return null;
	}

}
